module.exports = {
  beforeDestroy(){
        $router.to($route(this.args.LYLY,this.args))   
  },
  async fetch({ args, page }) {
    let DYGqq
    let DYGee
    /////////////////

      if (!$prefs.get('cookie强制不变')) {
           $ui.toast("获取cookie中")
       
        
    //let resqq = await http_dh.get('https:' + args.httpDR)
let resqq = await http_dh.get(args.httpDR)
               let cookieqq = resqq.headers['set-cookie']
    cookieqq = String(cookieqq).match(/(PHPSESSID=\S{3,55}?);/)[1]
    //cookieqq=typeof(cookieqq)

    $prefs.set('cookieaa', cookieqq)
       
       
    header_asb ={
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
        Cookie: cookieqq
      }
    }
    
     DYGqq={
        //大小，最多12
        spanCount: 12,
        title: resqq.data,
        onClick: () => {
          $clipboard.text = cookieqq
          $ui.toast("新cookie剪贴成功")
        }
      }

      }else{
           $ui.toast("上传cookie并强制保持不变")
         DYGqq={
        title: "上传cookie并强制保持不变"
      }
      }

    /////////////////


    let res = await http_dh.post(
      'https://' + $prefs.get('baseURL') + '/wtydfAA.htm',
      {
        method: 'POST',
        body:
          'form_page=1&key_myform=aaaaaa&form_serch_category=form_serch_18av'
      },

      header_asb
    )

    let ixa = res.headers['set-cookie']    

      if (!$prefs.get('cookie页面')) {
/*
    ////////开发者调试用/////////
    let resqqee = await http_dh.get('https:' + args.httpDR, header_asb)
    DYGee={
        title: resqqee.data,
        onClick: () => {
          $clipboard.text = resqqee.data
          $ui.toast("已剪贴")
        }
      }
    ////////开发者调试用/////////
    //*/
      }else{
        /*let LSPD
    if(args.httpDR=='//'+$prefs.get('baseURL') + '/news/ALL.html'){
      LSPD='index'
    }else{
      LSPD='xp1'    
    }*/
    
        this.finish()
        //$router.to($route(args.LYLY,args))
      }
    return [
      DYGqq,
      {
        title: res.data,
        onClick: () => {
          $clipboard.text = res.data
             $ui.toast("已剪贴")
        }
      },
      ////////////////////////////
      DYGee
      ////////////////////////////
    ]
  }
}

/*
module.exports = {
  async fetch({ args, page }) {
    /////////////////

    let resqq = await http_dh.get('https:' + args.httpDR)

    /////////////////
    let cookieqq = resqq.headers['set-cookie']
    cookieqq = String(cookieqq).match(/(PHPSESSID=\S{3,55}?);/)[1]
    //cookieqq=typeof(cookieqq)

    $prefs.set('cookieaa', cookieqq)

    header_asb = {
      headers: {
        Accept: 'application/json',
        'Content-Type': 'application/x-www-form-urlencoded',
        Cookie: cookieqq
      }
    }

    let res = await http_dh.post(
      'https://' + $prefs.get('baseURL') + '/wtydfAA.htm',
      {
        method: 'POST',
        body:
          'form_page=1&key_myform=aaaaaa&form_serch_category=form_serch_18av'
      },

      header_asb
    )

    ////////////////////////////
    let resqqee = await http_dh.get('https:' + args.httpDR, header_asb)
    ////////////////////////////

    let ixa = res.headers['set-cookie']
    //this.finish()
    return [
      {
        //大小，最多12
        spanCount: 12,
        title: resqq.data,
        onClick: () => {
          $clipboard.text = cookieqq
        }
      },
      {
        //大小，最多12
        spanCount: 12,
        title: res.data,
        onClick: () => {
          $clipboard.text = res.data
        }
      },
      ////////////////////////////
      {
        //大小，最多12
        spanCount: 12,
        title: resqqee.data,
        onClick: () => {
          $clipboard.text = resqqee.data
        }
      }
      ////////////////////////////
    ]
  }
}
*/
